<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			*{
				padding: 0;
				margin: 0;
			}
			#hd{
				width: 500px;
				height: 300px;
				background: blue;
			}
		</style>
		<script>
			
			window.onload=function(){
				var hd=document.getElementById("hd");
				//this在事件中指向的是事件源对象
				hd.onclick=function(){
					//hd.style.background='green';
					this.style.background='green';
				}	
			}
			
		</script>
	</head>
	<body>
		<div id="hd"></div>
	</body>
</html>
